package com.api.util;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public final class GenericUtils {

	public interface GenericType<T> {

	}

	private GenericUtils() {

	}

	public static Type getType(GenericType<?> object) {
		Class<?> objectClass = object.getClass();
		Type[] interfaces = objectClass.getGenericInterfaces();
		ParameterizedType paramType = (ParameterizedType) interfaces[0];
		return paramType.getActualTypeArguments()[0];
	}
}
